<template>
  <view>
    <u-grid :col="4" @click="gridClick">
      <u-grid-item :index="0">
        <u-icon name="photo" :size="46"></u-icon>
        <view class="grid-text">列表</view>
      </u-grid-item>
      <u-grid-item :index="1">
        <u-icon name="photo" :size="46"></u-icon>
        <view class="grid-text">表单</view>
      </u-grid-item>
      <u-grid-item :index="2">
        <u-icon name="photo" :size="46"></u-icon>
        <view class="grid-text">Grid布局</view>
      </u-grid-item>
    </u-grid>
    <view class="text-blue-500 text-[30px] border border-red-500">1231</view>
  </view>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { testGet } from '../../common/api/test'
const title = ref('Hello')

const getRequest = async () => {
  const res = await testGet({
    name: 123,
    password: 456
  })
}

const gridClick = (index: number) => {
  console.log(index)

  if (index === 1) {
    uni.navigateTo({
      url: '/pages/index/FormDemo'
    })
  } else if (index === 2) {
    uni.navigateTo({
      url: '/pages/index/GridDemo'
    })
  }
}
</script>

<style lang="scss"></style>
